﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public struct AnimData
{
     public CharactorState state;
     public Animation anim;

     public void Init(CharactorCtrl ctrl)
     {
          this.anim = ctrl.GetComponent<Animation>();
          this.state = CharactorState.Invalid;
     }

     public void SetState(CharactorState state)
     {
          if (this.state == state)
          {
               return;
          }
          this.state = state;
          string animName = this.state.ToString().ToLower();
          this.anim.CrossFade(animName);
     }
}
